# -*- coding: utf-8 -*-
# @Time : 2024/1/14 7:34 PM 
# @Author : Wayne
# @Email : 1
# @File : new_sqlServer.py
# @Project : pythonYoungWeb
# @DESCRIPTION :
import pymssql

# 连接SQL Server数据库
# conn = pymssql.connect(
#     'DRIVER={SQL Server}'
#     'SERVER=310542j5j0.vicp.fun'
#     'DATABASE=UFDATA_999_2023'
#     'DATABASE=UFDATA_999_2023'
#     'port=31322'
#     'PWD=szcz@2023'
# )

conn = pymssql.connect(
    server='70323oszj483.vicp.fun',
    user='ffsyuser',
    port='18951',
    password='qwaz123.',
    database='AIS20180421081721',
    as_dict=True
)
SQL_QUERY = """
select * from dbo.t_IcItem where FShortNumber ='03';
"""
cursor = conn.cursor()
cursor.execute(SQL_QUERY)
records = cursor.fetchall()
for r in records:
    print(r)
    # print(f"{r['CustomerID']}\t{r['OrderCount']}\t{r['CompanyName']}")